package com.example.administrator.easy.adapter;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.example.administrator.easy.model.GuangFxHeadResult;

import java.util.ArrayList;

/**
 * Created by Administrator on 2016/11/15.
 */

public class GuangFxHeadVpAdapter extends PagerAdapter{//
    private ArrayList<View> mList;
    private Context mContext;
    public GuangFxHeadVpAdapter(Context context,ArrayList<View> list){
       mList = list;
        mContext = context;
    }


    @Override
    public int getCount() {
        Log.e("Mainvpda",mList.size()+"");
        return mList.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==object;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        container.addView(mList.get(position));
        return mList.get(position);
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        //super.destroyItem(container, position, object);
        container.removeView(mList.get(position));
    }
}
